


*************************
***race and sentiment****
*************************

rename Q21_2 Black
recode Black("."=0) 
replace Black = 1 if jurisdiction == "Harris" & Q23Race_Harris == 1

rename Q21_1 White
recode White("."=0)
replace White = 1 if jurisdiction == "Harris" & Q23Race_Harris == 3


rename Q20 Latinx
recode Latinx("."=0)
recode Latinx(2=0)
replace Latinx = 1 if jurisdiction == "Harris" & Q23Race_Harris == 2

rename Q21_4 Asian
recode Asian("."=0)
replace Asian = 1 if jurisdiction == "Harris" & Q23Race_Harris == 4

gen female = 0
replace female = 1 if Q19 == 2
replace female = 1 if jurisdiction == "Harris" & Q22Gender_Harris == 2

rename Q2 Experience

rename Q4_7 ads
recode ads("."=0) 
rename Q4_8 news
recode news("."=0) 
rename Q4_9 email
recode email("."=0) 
rename Q4_11 website
recode website("."=0) 
rename Q4_12 outgroup
recode outgroup("."=0) 
rename Q4_13 recruit
recode recruit("."=0) 
rename Q4_14 peopletalk
recode peopletalk("."=0) 
rename Q4_15 other
recode other("."=0) 

gen firstime = 0 
replace firstime = 1 if Experience ==1

tab Age_cat
tab Experience
tab dem
***reverse coded***
recode work_difficult (1=4)(2=3)(3=2)(4=1)
recode Unfairly_blamed (1=4)(2=3)(3=2)(4=1)
recode Difficult_laws (1=4)(2=3)(3=2)(4=1)


corr ads news email website outgroup recruit peopletalk

****************************
****Fixed Effects Models****
****************************

***Table 4***

xtset jurisdictionID
xtlogit ads Experience Black Latinx Asian i.Age_cat dem female, fe
outreg2 using poll.doc, nolabel replace
xtset jurisdictionID
xtlogit news Experience Black Latinx Asian i.Age_cat dem female, fe
outreg2 using poll.doc, nolabel append
xtset jurisdictionID
xtlogit email Experience Black Latinx Asian i.Age_cat dem female, fe
outreg2 using poll.doc, nolabel append
xtset jurisdictionID
xtlogit website Experience Black Latinx Asian i.Age_cat dem female, fe
outreg2 using poll.doc, nolabel append
xtset jurisdictionID
xtlogit outgroup Experience Black Latinx Asian i.Age_cat dem female, fe
outreg2 using poll.doc, nolabel append
xtset jurisdictionID
xtlogit recruit Experience Black Latinx Asian i.Age_cat dem female, fe
outreg2 using poll.doc, nolabel append
xtset jurisdictionID
xtlogit peopletalk Experience Black Latinx Asian i.Age_cat dem female, fe
outreg2 using poll.doc, nolabel append


*****************************
****marginal effects plots***
*****************************


xtset jurisdictionID
xtlogit ads i.Age_cat dem female Asian Latinx Black Experience, fe
margins, dydx(*) post
marginsplot,  horizontal noseparator xline(0) recast(scatter) graphregion(color(white)) bgcolor(white) saving(xtadsft)

xtset jurisdictionID
xtlogit news i.Age_cat dem female Asian Latinx Black Experience, fe
margins, dydx(*) post
marginsplot,  horizontal noseparator xline(0) recast(scatter) graphregion(color(white)) bgcolor(white) saving(xtnewsft)

xtset jurisdictionID
xtlogit email i.Age_cat dem female Asian Latinx Black Experience, fe
margins, dydx(*) post
marginsplot,  horizontal noseparator xline(0) recast(scatter) graphregion(color(white)) bgcolor(white) saving(xtemailft)

xtset jurisdictionID
xtlogit website i.Age_cat dem female Asian Latinx Black Experience, fe
margins, dydx(*) post
marginsplot,  horizontal noseparator xline(0) recast(scatter) graphregion(color(white)) bgcolor(white) saving(xtwebft)

graph combine xtadsft.gph xtnewsft.gph xtemailft.gph xtwebft.gph

xtset jurisdictionID
xtlogit outgroup i.Age_cat dem female Asian Latinx Black Experience, fe
margins, dydx(*) post
marginsplot,  horizontal noseparator xline(0) recast(scatter) graphregion(color(white)) bgcolor(white) saving(xtoutft)

xtset jurisdictionID
xtlogit recruit i.Age_cat dem female Asian Latinx Black Experience, fe
margins, dydx(*) post
marginsplot,  horizontal noseparator xline(0) recast(scatter) graphregion(color(white)) bgcolor(white) saving(xtrecruitft)

xtset jurisdictionID
xtlogit peopletalk i.Age_cat dem female Asian Latinx Black Experience, fe
margins, dydx(*) post
marginsplot,  horizontal noseparator xline(0) recast(scatter) graphregion(color(white)) bgcolor(white) saving(xttalkft)

graph combine xtoutft.gph xtrecruitft.gph xttalkft.gph



*****************************
****marginal effects table***
*****************************


xtset jurisdictionID
xtlogit ads i.Age_cat dem female Asian Latinx Black Experience, fe
margins, dydx(*) post
outreg2 using margpoll.doc, nolabel replace
xtset jurisdictionID
xtlogit news i.Age_cat dem female Asian Latinx Black Experience, fe
margins, dydx(*) post
outreg2 using margpoll.doc, nolabel append
xtset jurisdictionID
xtlogit email i.Age_cat dem female Asian Latinx Black Experience, fe
margins, dydx(*) post
outreg2 using margpoll.doc, nolabel append
xtset jurisdictionID
xtlogit website i.Age_cat dem female Asian Latinx Black Experience, fe
margins, dydx(*) post
outreg2 using margpoll.doc, nolabel append
xtset jurisdictionID
xtlogit outgroup i.Age_cat dem female Asian Latinx Black Experience, fe
margins, dydx(*) post
outreg2 using margpoll.doc, nolabel append
xtset jurisdictionID
xtlogit recruit i.Age_cat dem female Asian Latinx Black Experience, fe
margins, dydx(*) post
outreg2 using margpoll.doc, nolabel append
xtset jurisdictionID
xtlogit peopletalk i.Age_cat dem female Asian Latinx Black Experience, fe
margins, dydx(*) post
outreg2 using margpoll.doc, nolabel append


**************
***Appendix***
**************

***First Timers****

xtset jurisdictionID
xtlogit ads firstime i.Age_cat dem Black Latinx Asian female, fe
outreg2 using poll2.doc, nolabel replace
xtset jurisdictionID
xtlogit news firstime i.Age_cat dem Black Latinx Asian female, fe
outreg2 using poll2.doc, nolabel append
xtset jurisdictionID
xtlogit email firstime i.Age_cat dem Black Latinx Asian female, fe
outreg2 using poll2.doc, nolabel append
xtset jurisdictionID
xtlogit website firstime i.Age_cat dem Black Latinx Asian female, fe
outreg2 using poll2.doc, nolabel append
xtset jurisdictionID
xtlogit outgroup firstime i.Age_cat dem Black Latinx Asian female, fe
outreg2 using poll2.doc, nolabel append
xtset jurisdictionID
xtlogit recruit firstime i.Age_cat dem Black Latinx Asian female, fe
outreg2 using poll2.doc, nolabel append
xtset jurisdictionID
xtlogit peopletalk firstime i.Age_cat dem Black Latinx Asian female, fe
outreg2 using poll2.doc, nolabel append

***First Timers Appendix Marginsplot***

xtset jurisdictionID
xtlogit ads i.Age_cat dem female Asian Latinx Black firstime, fe
margins, dydx(*) post
marginsplot,  horizontal noseparator xline(0) recast(scatter) graphregion(color(white)) bgcolor(white) saving(xtads)

xtset jurisdictionID
xtlogit news i.Age_cat dem female Asian Latinx Black firstime, fe
margins, dydx(*) post
marginsplot,  horizontal noseparator xline(0) recast(scatter) graphregion(color(white)) bgcolor(white) saving(xtnews)

xtset jurisdictionID
xtlogit email i.Age_cat dem female Asian Latinx Black firstime, fe
margins, dydx(*) post
marginsplot,  horizontal noseparator xline(0) recast(scatter) graphregion(color(white)) bgcolor(white) saving(xtemail)

xtset jurisdictionID
xtlogit website i.Age_cat dem female Asian Latinx Black firstime, fe
margins, dydx(*) post
marginsplot,  horizontal noseparator xline(0) recast(scatter) graphregion(color(white)) bgcolor(white) saving(xtweb)

graph combine xtads.gph xtnews.gph xtemail.gph xtweb.gph

xtset jurisdictionID
xtlogit outgroup i.Age_cat dem female Asian Latinx Black firstime, fe
margins, dydx(*) post
marginsplot,  horizontal noseparator xline(0) recast(scatter) graphregion(color(white)) bgcolor(white) saving(xtout)

xtset jurisdictionID
xtlogit recruit i.Age_cat dem female Asian Latinx Black firstime, fe
margins, dydx(*) post
marginsplot,  horizontal noseparator xline(0) recast(scatter) graphregion(color(white)) bgcolor(white) saving(xtrecruit)

xtset jurisdictionID
xtlogit peopletalk i.Age_cat dem female Asian Latinx Black firstime, fe
margins, dydx(*) post
marginsplot,  horizontal noseparator xline(0) recast(scatter) graphregion(color(white)) bgcolor(white) saving(xttalk)

graph combine xtout.gph xtrecruit.gph xttalk.gph

***First Timers Appendix Margins Table***


xtset jurisdictionID
xtlogit ads firstime i.Age_cat dem Black Latinx Asian female, fe
margins, dydx(*) post
outreg2 using poll3.doc, nolabel replace

xtset jurisdictionID
xtlogit news firstime i.Age_cat dem Black Latinx Asian female, fe
margins, dydx(*) post
outreg2 using poll3.doc, nolabel append

xtset jurisdictionID
xtlogit email firstime i.Age_cat dem Black Latinx Asian female, fe
margins, dydx(*) post
outreg2 using poll3.doc, nolabel append

xtset jurisdictionID
xtlogit website firstime i.Age_cat dem Black Latinx Asian female, fe
margins, dydx(*) post
outreg2 using poll3.doc, nolabel append

xtset jurisdictionID
xtlogit outgroup firstime i.Age_cat dem Black Latinx Asian female, fe
margins, dydx(*) post
outreg2 using poll3.doc, nolabel append

xtset jurisdictionID
xtlogit recruit firstime i.Age_cat dem Black Latinx Asian female, fe
margins, dydx(*) post
outreg2 using poll3.doc, nolabel append

xtset jurisdictionID
xtlogit peopletalk firstime i.Age_cat dem Black Latinx Asian female, fe
margins, dydx(*) post
outreg2 using poll3.doc, nolabel append
